package br.com.bradseg.scpv.sistemacursinhoprevestibular.model.professor.ejb;

import java.util.List;

import javax.ejb.SessionBean;

import org.apache.log4j.Logger;

import br.com.bradseg.bsad.base.model.SessionFacadeBase;
import br.com.bradseg.bsad.exception.IntegrationException;
import br.com.bradseg.scpv.sistemacursinhoprevestibular.model.dao.DB2DAOFactoryImpl;
import br.com.bradseg.scpv.sistemacursinhoprevestibular.model.professor.dao.ProfessorDAO;
import br.com.bradseg.scpv.sistemacursinhoprevestibular.model.vo.ProfessorVO;

/**
 * Bean implementation class for Enterprise Bean: ProfessorSessionFacade
 */
public class ProfessorSessionFacadeBean extends SessionFacadeBase implements
		SessionBean {

	static final long serialVersionUID = 3206093459760846163L;
	private static final DB2DAOFactoryImpl DB2DAOFACTORY = DB2DAOFactoryImpl
			.getInstance();
	private static final Logger LOGGER = Logger
			.getLogger(ProfessorSessionFacadeBean.class);

	public List<ProfessorVO> listarProfessor(ProfessorVO filtroVO)
			throws IntegrationException {
		// TODO Rosangela - Colocar log

		try {
			ProfessorDAO professorDAO = DB2DAOFACTORY.getProfessorDAO();

			return professorDAO.listarProfessor(filtroVO);

		} finally {
			endMethod(LOGGER, "listarAcertos(ChaveSinistroVO chaveSinistroVO)");
		}
	}

	public ProfessorVO incluirProfessor(ProfessorVO filtro) throws IntegrationException {
		beginMethod(LOGGER, "incluirProfessor(filtro)");

		try {
			
			ProfessorDAO professorDAO = DB2DAOFACTORY.getProfessorDAO();
			
			ProfessorVO professorVO = professorDAO.incluirProfessor(filtro);
            professorVO.getNome();
            professorVO.getCpf();
            
			
			return professorVO; 

		} finally {
			endMethod(LOGGER, "obterPagamentoParaConciliacao(filtro)");
		}
	}

}
